package com.okay.volume
import android.app.Activity
import android.os.*
import android.widget.Button
import android.widget.TextView
import com.okay.testclass.R

/**
 * @author liaoweiwei
 * @since 12/14/21 3:51 PM
 *
 * 检测录音分贝的
 */
class TestAudioRecorderActivity : Activity() {



    private var mTextView: TextView? = null
    private var detectionView: DetectionView? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_test_audio_recorder)
        mTextView = findViewById(R.id.text_view)
        detectionView = findViewById(R.id.detection_view)

        findViewById<Button>(R.id.button1).setOnClickListener {

            detectionView?.startRecorder()
        }
        findViewById<Button>(R.id.button2).setOnClickListener {
            detectionView?.stopRecorder()
        }
        findViewById<Button>(R.id.button3).setOnClickListener {
            finish()
        }

    }

    override fun onDestroy() {
        super.onDestroy()
        detectionView?.stopRecorder()
    }
}